package org.dallasrowing.logbook.ui.view;

import java.util.Date;

public class ViewDamageEntry {
	private Date entryDate;
	private String boatName;
	private String reporterName;
	private String part;
	private String description;
	
	public ViewDamageEntry(Date entryDate, String boatName, String reporterName, String part, String description) {
		this.entryDate = entryDate;
		this.boatName = boatName;
		this.reporterName = reporterName;
		this.part = part;
		this.description = description;
	}
	
	public Date getEntryDate() {
		return entryDate;
	}
	public String getBoatName() {
		return boatName;
	}
	public String getReporterName() {
		return reporterName;
	}
	public String getPart() {
		return part;
	}
	public String getDescription() {
		return description;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result
				+ ((boatName == null) ? 0 : boatName.hashCode());
		result = prime * result
				+ ((description == null) ? 0 : description.hashCode());
		result = prime * result
				+ ((entryDate == null) ? 0 : entryDate.hashCode());
		result = prime * result + ((part == null) ? 0 : part.hashCode());
		result = prime * result
				+ ((reporterName == null) ? 0 : reporterName.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		ViewDamageEntry other = (ViewDamageEntry) obj;
		if (boatName == null) {
			if (other.boatName != null)
				return false;
		} else if (!boatName.equals(other.boatName))
			return false;
		if (description == null) {
			if (other.description != null)
				return false;
		} else if (!description.equals(other.description))
			return false;
		if (entryDate == null) {
			if (other.entryDate != null)
				return false;
		} else if (!entryDate.equals(other.entryDate))
			return false;
		if (part == null) {
			if (other.part != null)
				return false;
		} else if (!part.equals(other.part))
			return false;
		if (reporterName == null) {
			if (other.reporterName != null)
				return false;
		} else if (!reporterName.equals(other.reporterName))
			return false;
		return true;
	}


}
